﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace cselstad_poc
{
    public partial class frmMain : Form
    {
        public string connectionString = "Data Source=sparky;Initial Catalog=cps420_team2_poc;Persist Security Info=True;User ID=cps420team2;Password=team2";
        public frmMain()
        {
            InitializeComponent();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmDB db = new frmDB();
            db.Enabled = true;
            db.Visible = true;

        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //string ConnectionString = "Data Source=sparky;Initial Catalog=cps420_team2_poc;Persist Security Info=True;User ID=cps420team2;Password=team2"
            //SqlConnection connect = new SqlConnection(ConnectionString);

            /*SqlConnection connection = new SqlConnection();
            
            
            connection.ConnectionString = "Data Source=sparky;Initial Catalog=cps420_team2_poc;Persist Security Info=True;User ID=cps420team2;Password=team2";
            connection.Open();         

            SqlCommand command = new SqlCommand("INSERT INTO AddressEntry(Name, Email) " +
                            "Values('testdummy', 'tester@gmail.com')", connection);

            command.ExecuteNonQuery();*/



            /*AddressEntryDAO address = new AddressEntryDAO();
            address.ConnectDatabase(connectionString);
            AddressEntry insert = new AddressEntry();
            insert.SetName("Obama");
            insert.SetEmail("bobama@whitehouse.gov");
            address.CreateRecord(insert);*/
            
            /*AddressEntry delete = new AddressEntry();
            delete.SetName("Obama");
            delete.SetEmail("BObama@whitehouse.gov");
            address.DeleteRecord(delete);*/

            /*AddressEntry updateold = new AddressEntry();
            AddressEntry updatenew = new AddressEntry();
            updateold.SetName("Jim");
            updateold.SetEmail("jimjim@gmail.com");
            updatenew.SetName("Jimmy");
            updatenew.SetEmail("jimmy@gmail.com");
            address.UpdateRecord(updateold, updatenew);
            */




        }
    }
}
